Optimal. Leaf size=85 \[ -\frac {a^2 b \log (a \sin (x)+b)}{\left (a^2-b^2\right )^2}-\frac {\sec ^2(x) (b-a \sin (x))}{2 \left (a^2-b^2\right )}-\frac {a \log (1-\sin (x))}{4 (a+b)^2}+\frac {a \log (\sin (x)+1)}{4 (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3872, 2837, 12, 823, 801} \[ -\frac {a^2 b \log (a \sin (x)+b)}{\left (a^2-b^2\right )^2}-\frac {\sec ^2(x) (b-a \sin (x))}{2 \left (a^2-b^2\right )}-\frac {a \log (1-\sin (x))}{4 (a+b)^2}+\frac {a \log (\sin (x)+1)}{4 (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 801
Rule 823
Rule 2837
Rule 3872
Rubi steps
\begin {align*} \int \frac {\sec ^3(x)}{a+b \csc (x)} \, dx &=\int \frac {\sec ^2(x) \tan (x)}{b+a \sin (x)} \, dx\\ &=a^3 \operatorname {Subst}\left (\int \frac {x}{a (b+x) \left (a^2-x^2\right )^2} \, dx,x,a \sin (x)\right )\\ &=a^2 \operatorname {Subst}\left (\int \frac {x}{(b+x) \left (a^2-x^2\right )^2} \, dx,x,a \sin (x)\right )\\ &=-\frac {\sec ^2(x) (b-a \sin (x))}{2 \left (a^2-b^2\right )}+\frac {\operatorname {Subst}\left (\int \frac {-a^2 b+a^2 x}{(b+x) \left (a^2-x^2\right )} \, dx,x,a \sin (x)\right )}{2 \left (a^2-b^2\right )}\\ &=-\frac {\sec ^2(x) (b-a \sin (x))}{2 \left (a^2-b^2\right )}+\frac {\operatorname {Subst}\left (\int \left (\frac {a (a-b)}{2 (a+b) (a-x)}+\frac {a (a+b)}{2 (a-b) (a+x)}-\frac {2 a^2 b}{(a-b) (a+b) (b+x)}\right ) \, dx,x,a \sin (x)\right )}{2 \left (a^2-b^2\right )}\\ &=-\frac {a \log (1-\sin (x))}{4 (a+b)^2}+\frac {a \log (1+\sin (x))}{4 (a-b)^2}-\frac {a^2 b \log (b+a \sin (x))}{\left (a^2-b^2\right )^2}-\frac {\sec ^2(x) (b-a \sin (x))}{2 \left (a^2-b^2\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.41, size = 139, normalized size = 1.64 \[ \frac {\csc (x) (a \sin (x)+b) \left (-\frac {4 a^2 b \log (a \sin (x)+b)}{\left (a^2-b^2\right )^2}+\frac {1}{(a+b) \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )^2}+\frac {1}{(b-a) \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )^2}-\frac {2 a \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )}{(a+b)^2}+\frac {2 a \log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )}{(a-b)^2}\right )}{4 (a+b \csc (x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.73, size = 119, normalized size = 1.40 \[ -\frac {4 \, a^{2} b \cos \relax (x)^{2} \log \left (a \sin \relax (x) + b\right ) - {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \cos \relax (x)^{2} \log \left (\sin \relax (x) + 1\right ) + {\left (a^{3} - 2 \, a^{2} b + a b^{2}\right )} \cos \relax (x)^{2} \log \left (-\sin \relax (x) + 1\right ) + 2 \, a^{2} b - 2 \, b^{3} - 2 \, {\left (a^{3} - a b^{2}\right )} \sin \relax (x)}{4 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cos \relax (x)^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.49, size = 129, normalized size = 1.52 \[ -\frac {a^{3} b \log \left ({\left | a \sin \relax (x) + b \right |}\right )}{a^{5} - 2 \, a^{3} b^{2} + a b^{4}} + \frac {a \log \left (\sin \relax (x) + 1\right )}{4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac {a \log \left (-\sin \relax (x) + 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {a^{2} b - b^{3} - {\left (a^{3} - a b^{2}\right )} \sin \relax (x)}{2 \, {\left (a + b\right )}^{2} {\left (a - b\right )}^{2} {\left (\sin \relax (x) + 1\right )} {\left (\sin \relax (x) - 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.51, size = 89, normalized size = 1.05 \[ -\frac {a^{2} b \ln \left (b +a \sin \relax (x )\right )}{\left (a +b \right )^{2} \left (a -b \right )^{2}}-\frac {1}{\left (4 a +4 b \right ) \left (-1+\sin \relax (x )\right )}-\frac {a \ln \left (-1+\sin \relax (x )\right )}{4 \left (a +b \right )^{2}}-\frac {1}{\left (4 a -4 b \right ) \left (1+\sin \relax (x )\right )}+\frac {a \ln \left (1+\sin \relax (x )\right )}{4 \left (a -b \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 108, normalized size = 1.27 \[ -\frac {a^{2} b \log \left (a \sin \relax (x) + b\right )}{a^{4} - 2 \, a^{2} b^{2} + b^{4}} + \frac {a \log \left (\sin \relax (x) + 1\right )}{4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )}} - \frac {a \log \left (\sin \relax (x) - 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {a \sin \relax (x) - b}{2 \, {\left ({\left (a^{2} - b^{2}\right )} \sin \relax (x)^{2} - a^{2} + b^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.38, size = 96, normalized size = 1.13 \[ \ln \left (b+a\,\sin \relax (x)\right )\,\left (\frac {a}{4\,{\left (a+b\right )}^2}-\frac {a}{4\,{\left (a-b\right )}^2}\right )-\frac {\frac {b}{2\,\left (a^2-b^2\right )}-\frac {a\,\sin \relax (x)}{2\,\left (a^2-b^2\right )}}{{\cos \relax (x)}^2}+\frac {a\,\ln \left (\sin \relax (x)+1\right )}{4\,{\left (a-b\right )}^2}-\frac {a\,\ln \left (\sin \relax (x)-1\right )}{4\,{\left (a+b\right )}^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{3}{\relax (x )}}{a + b \csc {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________